<?php
	class Task_dependency extends AppModel
	{
		var $name = 'Task_dependency';
		var $useTable = 'function_dependencies';	
		
		var $belongsTo = array('Task' =>
							array('className' => 'Task',
								  'foreignKey' => 'id_funcion',
  								  'conditions' => '',
								  'fields' => '',
								  'order' => ''
								),
							);
							
		
		/*La funcion devuelve Array(id => 'nombre, "sede" sede')*/
		function obtenerDatosAMostrar( $conditions = null )
		{
			$task_dependency = $this->findAll ($conditions);
			$return = array();

			foreach ($task_dependency as $task)
			{
				$return[$task['Task']['id'] ] = $task['Task']['nombre'];
			}

			return $return; 
		}
							
		
	}
?>